import { WebView } from 'react-native-webview';
import Constants from 'expo-constants';
import { StyleSheet,View } from 'react-native';
import { useRoute } from "@react-navigation/native";
import Headers from '@/app/components/header/Headers'
export default function webview() {
  let route:any = useRoute();
  let params = route.params||{};
  console.log(JSON.stringify(route.params));
  return (
    <View style={styles.container}>
      <Headers title="扫一扫" centerColor={'#333'} leftIcon={require('@/assets/images/icon/back.png')} barStyle={0} backgroundColor={'#fff'} setTranslucent={false} />
      <WebView
        style={styles.webviewContainer}
        source={{ uri: params.url||'https://expo.dev' }}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    // marginTop: Constants.statusBarHeight,
    flexDirection:'column',
  },
  webviewContainer:{
    flex: 1,
  }
});